require 'rho/rhocontroller'
require 'helpers/browser_helper'

class NewsController < Rho::RhoController
  include BrowserHelper

  #GET /News
  def index
    @news = News.find(:all)
    render :back => '/app'
  end

  # GET /News/{1}
  def show
    @news = News.find(@params['id'])
    if @news
      render :action => :show, :back => url_for(:action => :index)
    else
      redirect :action => :index
    end
  end

  def set_iPad_tabbar
    tabbar = 
      [ 
        { :label => "HCDE", :model => :HCDE, :action => :index, :icon => "public/images/tab/icon_rss.png", :reload => true },
        { :label => "TEA", :model => :Tea, :action => :index, :icon => "public/images/tab/icon_rss.png" },
        { :label => "TASBO Trng Calendar", :model => :TasboCal, :action => :index, :icon => "public/images/tab/icon_rss.png" }
        #{ :label => "More", :action => '/app/Session', :icon => "public/images/tab/icon_more.png" }]
      ]
      NativeBar.create(Rho::RhoApplication::VTABBAR_TYPE, tabbar)
      $tabbar_active = true
      NativeBar.switch_tab(0)
    end
end
